\(\int \frac {a+b \log (c x^n)}{d+\frac {e}{x}} \, dx\) [332]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [F]
   Sympy [A] (verification not implemented)
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 20, antiderivative size = 69 \[ \int \frac {a+b \log \left (c x^n\right )}{d+\frac {e}{x}} \, dx=\frac {a x}{d}-\frac {b n x}{d}+\frac {b x \log \left (c x^n\right )}{d}-\frac {e \left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {d x}{e}\right )}{d^2}-\frac {b e n \operatorname {PolyLog}\left (2,-\frac {d x}{e}\right )}{d^2} \]

[Out]

a*x/d-b*n*x/d+b*x*ln(c*x^n)/d-e*(a+b*ln(c*x^n))*ln(1+d*x/e)/d^2-b*e*n*polylog(2,-d*x/e)/d^2

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {199, 45, 2367, 2332, 2354, 2438} \[ \int \frac {a+b \log \left (c x^n\right )}{d+\frac {e}{x}} \, dx=-\frac {e \log \left (\frac {d x}{e}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{d^2}+\frac {a x}{d}+\frac {b x \log \left (c x^n\right )}{d}-\frac {b e n \operatorname {PolyLog}\left (2,-\frac {d x}{e}\right )}{d^2}-\frac {b n x}{d} \]

[In]

Int[(a + b*Log[c*x^n])/(d + e/x),x]

[Out]

(a*x)/d - (b*n*x)/d + (b*x*Log[c*x^n])/d - (e*(a + b*Log[c*x^n])*Log[1 + (d*x)/e])/d^2 - (b*e*n*PolyLog[2, -((
d*x)/e)])/d^2

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[x^(n*p)*(b + a/x^n)^p, x] /; FreeQ[{a, b}, x] && LtQ[n, 0]
 && IntegerQ[p]

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2354

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[Log[1 + e*(x/d)]*((a +
b*Log[c*x^n])^p/e), x] - Dist[b*n*(p/e), Int[Log[1 + e*(x/d)]*((a + b*Log[c*x^n])^(p - 1)/x), x], x] /; FreeQ[
{a, b, c, d, e, n}, x] && IGtQ[p, 0]

Rule 2367

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = Expand
Integrand[(a + b*Log[c*x^n])^p, (d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n, p, q, r}
, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[r]))

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {a+b \log \left (c x^n\right )}{d}-\frac {e \left (a+b \log \left (c x^n\right )\right )}{d (e+d x)}\right ) \, dx \\ & = \frac {\int \left (a+b \log \left (c x^n\right )\right ) \, dx}{d}-\frac {e \int \frac {a+b \log \left (c x^n\right )}{e+d x} \, dx}{d} \\ & = \frac {a x}{d}-\frac {e \left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {d x}{e}\right )}{d^2}+\frac {b \int \log \left (c x^n\right ) \, dx}{d}+\frac {(b e n) \int \frac {\log \left (1+\frac {d x}{e}\right )}{x} \, dx}{d^2} \\ & = \frac {a x}{d}-\frac {b n x}{d}+\frac {b x \log \left (c x^n\right )}{d}-\frac {e \left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {d x}{e}\right )}{d^2}-\frac {b e n \text {Li}_2\left (-\frac {d x}{e}\right )}{d^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.96 \[ \int \frac {a+b \log \left (c x^n\right )}{d+\frac {e}{x}} \, dx=\frac {a d x-b d n x-a e \log \left (1+\frac {d x}{e}\right )+b \log \left (c x^n\right ) \left (d x-e \log \left (1+\frac {d x}{e}\right )\right )-b e n \operatorname {PolyLog}\left (2,-\frac {d x}{e}\right )}{d^2} \]

[In]

Integrate[(a + b*Log[c*x^n])/(d + e/x),x]

[Out]

(a*d*x - b*d*n*x - a*e*Log[1 + (d*x)/e] + b*Log[c*x^n]*(d*x - e*Log[1 + (d*x)/e]) - b*e*n*PolyLog[2, -((d*x)/e
)])/d^2

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.11 (sec) , antiderivative size = 188, normalized size of antiderivative = 2.72

method result size
risch \(\frac {b \ln \left (x^{n}\right ) x}{d}-\frac {b \ln \left (x^{n}\right ) e \ln \left (d x +e \right )}{d^{2}}-\frac {b n x}{d}-\frac {b n e}{d^{2}}+\frac {b n e \ln \left (d x +e \right ) \ln \left (-\frac {d x}{e}\right )}{d^{2}}+\frac {b n e \operatorname {dilog}\left (-\frac {d x}{e}\right )}{d^{2}}+\left (-\frac {i b \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )}{2}+\frac {i b \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}+\frac {i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}-\frac {i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}+b \ln \left (c \right )+a \right ) \left (\frac {x}{d}-\frac {e \ln \left (d x +e \right )}{d^{2}}\right )\) \(188\)

[In]

int((a+b*ln(c*x^n))/(d+e/x),x,method=_RETURNVERBOSE)

[Out]

b*ln(x^n)/d*x-b*ln(x^n)*e/d^2*ln(d*x+e)-b*n*x/d-b*n*e/d^2+b*n*e/d^2*ln(d*x+e)*ln(-d*x/e)+b*n*e/d^2*dilog(-d*x/
e)+(-1/2*I*b*Pi*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+1/2*I*b*Pi*csgn(I*c)*csgn(I*c*x^n)^2+1/2*I*b*Pi*csgn(I*x^n
)*csgn(I*c*x^n)^2-1/2*I*b*Pi*csgn(I*c*x^n)^3+b*ln(c)+a)*(x/d-e/d^2*ln(d*x+e))

Fricas [F]

\[ \int \frac {a+b \log \left (c x^n\right )}{d+\frac {e}{x}} \, dx=\int { \frac {b \log \left (c x^{n}\right ) + a}{d + \frac {e}{x}} \,d x } \]

[In]

integrate((a+b*log(c*x^n))/(d+e/x),x, algorithm="fricas")

[Out]

integral((b*x*log(c*x^n) + a*x)/(d*x + e), x)

Sympy [A] (verification not implemented)

Time = 42.53 (sec) , antiderivative size = 163, normalized size of antiderivative = 2.36 \[ \int \frac {a+b \log \left (c x^n\right )}{d+\frac {e}{x}} \, dx=- \frac {a e \left (\begin {cases} \frac {x}{e} & \text {for}\: d = 0 \\\frac {\log {\left (d x + e \right )}}{d} & \text {otherwise} \end {cases}\right )}{d} + \frac {a x}{d} + \frac {b e n \left (\begin {cases} \frac {x}{e} & \text {for}\: d = 0 \\\frac {\begin {cases} - \operatorname {Li}_{2}\left (\frac {d x e^{i \pi }}{e}\right ) & \text {for}\: \frac {1}{\left |{x}\right |} < 1 \wedge \left |{x}\right | < 1 \\\log {\left (e \right )} \log {\left (x \right )} - \operatorname {Li}_{2}\left (\frac {d x e^{i \pi }}{e}\right ) & \text {for}\: \left |{x}\right | < 1 \\- \log {\left (e \right )} \log {\left (\frac {1}{x} \right )} - \operatorname {Li}_{2}\left (\frac {d x e^{i \pi }}{e}\right ) & \text {for}\: \frac {1}{\left |{x}\right |} < 1 \\- {G_{2, 2}^{2, 0}\left (\begin {matrix} & 1, 1 \\0, 0 & \end {matrix} \middle | {x} \right )} \log {\left (e \right )} + {G_{2, 2}^{0, 2}\left (\begin {matrix} 1, 1 & \\ & 0, 0 \end {matrix} \middle | {x} \right )} \log {\left (e \right )} - \operatorname {Li}_{2}\left (\frac {d x e^{i \pi }}{e}\right ) & \text {otherwise} \end {cases}}{d} & \text {otherwise} \end {cases}\right )}{d} - \frac {b e \left (\begin {cases} \frac {x}{e} & \text {for}\: d = 0 \\\frac {\log {\left (d x + e \right )}}{d} & \text {otherwise} \end {cases}\right ) \log {\left (c x^{n} \right )}}{d} - \frac {b n x}{d} + \frac {b x \log {\left (c x^{n} \right )}}{d} \]

[In]

integrate((a+b*ln(c*x**n))/(d+e/x),x)

[Out]

-a*e*Piecewise((x/e, Eq(d, 0)), (log(d*x + e)/d, True))/d + a*x/d + b*e*n*Piecewise((x/e, Eq(d, 0)), (Piecewis
e((-polylog(2, d*x*exp_polar(I*pi)/e), (Abs(x) < 1) & (1/Abs(x) < 1)), (log(e)*log(x) - polylog(2, d*x*exp_pol
ar(I*pi)/e), Abs(x) < 1), (-log(e)*log(1/x) - polylog(2, d*x*exp_polar(I*pi)/e), 1/Abs(x) < 1), (-meijerg(((),
 (1, 1)), ((0, 0), ()), x)*log(e) + meijerg(((1, 1), ()), ((), (0, 0)), x)*log(e) - polylog(2, d*x*exp_polar(I
*pi)/e), True))/d, True))/d - b*e*Piecewise((x/e, Eq(d, 0)), (log(d*x + e)/d, True))*log(c*x**n)/d - b*n*x/d +
 b*x*log(c*x**n)/d

Maxima [F]

\[ \int \frac {a+b \log \left (c x^n\right )}{d+\frac {e}{x}} \, dx=\int { \frac {b \log \left (c x^{n}\right ) + a}{d + \frac {e}{x}} \,d x } \]

[In]

integrate((a+b*log(c*x^n))/(d+e/x),x, algorithm="maxima")

[Out]

a*(x/d - e*log(d*x + e)/d^2) + b*integrate((x*log(c) + x*log(x^n))/(d*x + e), x)

Giac [F]

\[ \int \frac {a+b \log \left (c x^n\right )}{d+\frac {e}{x}} \, dx=\int { \frac {b \log \left (c x^{n}\right ) + a}{d + \frac {e}{x}} \,d x } \]

[In]

integrate((a+b*log(c*x^n))/(d+e/x),x, algorithm="giac")

[Out]

integrate((b*log(c*x^n) + a)/(d + e/x), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {a+b \log \left (c x^n\right )}{d+\frac {e}{x}} \, dx=\int \frac {a+b\,\ln \left (c\,x^n\right )}{d+\frac {e}{x}} \,d x \]

[In]

int((a + b*log(c*x^n))/(d + e/x),x)

[Out]

int((a + b*log(c*x^n))/(d + e/x), x)